<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .dome{
            width: 300px;
            height: 300px;
            background-color: aqua;
        }
    </style>
</head>
<body>
    <div class="dome" id="domes"></div>
    <button onclick="add()">添加事件</button>
    <button onclick="remove()">清除事件</button>
</body>
<script type="text/javascript">
    function enter(){
        console.log('进来了');
    }
    function add(){
        document.getElementById('domes').addEventListener('mouseover',enter)
    }
    function remove(){
        document.getElementById('domes').removeEventListener('mouseover',enter)
    }
   
</script>
</html>